unit Unit_Of_Connect_And_Choise_FI;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, Work_With_ORDERBOOK;

type
  TForm_Of_Connect_And_Choise_FI = class(TForm)
    Slot_Label: TLabel;
    SlotCB: TComboBox;
    Panel_Of_Connect_And_Choise_FI: TPanel;
    ServerLabel: TLabel;
    LoginLabel: TLabel;
    PassLabel: TLabel;
    ServerEdit: TEdit;
    LoginEdit: TEdit;
    PasswordEdit: TEdit;
    ConnectBtn: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure ConnectBtnClick(Sender: TObject);
  private
    { Private declarations }
    myStakan:TStakan_Translator;

    function getSlotID:Integer;
    procedure setSlotID(SlotID_:Integer);
    function getServer:String;
    procedure setServer(Server_:String);
    function getLogin:String;
    procedure setLogin(login_:String);
    function getPassword:String;
    procedure setPassword(pass_:String);

  public
    { Public declarations }
    property Stakan:TStakan_Translator read myStakan;
    property SlotID:Integer read getSlotID write setSlotID;
    property Server:String read getServer write setServer;
    property Login:String read getLogin write setLogin;
    property Password:String read getPassword write setPassword;
    procedure Connect(top_,left_:Integer);
  end;

var
  Form_Of_Connect_And_Choise_FI: TForm_Of_Connect_And_Choise_FI;

implementation

{$R *.dfm}

function TForm_Of_Connect_And_Choise_FI.getSlotID:Integer;
begin
    Result:=SlotCB.ItemIndex;
end;

procedure TForm_Of_Connect_And_Choise_FI.setSlotID(SlotID_:Integer);
begin
    SlotCB.ItemIndex:=SlotID_;
end;

function TForm_Of_Connect_And_Choise_FI.getServer:String;
begin
    Result:=ServerEdit.Text;
end;

procedure TForm_Of_Connect_And_Choise_FI.setServer(Server_:String);
begin
    ServerEdit.Text:=Server_;
end;

function TForm_Of_Connect_And_Choise_FI.getLogin:String;
begin
    Result:=LoginEdit.Text;
end;

procedure TForm_Of_Connect_And_Choise_FI.setLogin(login_:String);
begin
    LoginEdit.Text:=login_;
end;

function TForm_Of_Connect_And_Choise_FI.getPassword:String;
begin
    Result:=PasswordEdit.Text;
end;
procedure TForm_Of_Connect_And_Choise_FI.setPassword(pass_:String);
begin
    PasswordEdit.Text:=pass_;
end;

procedure TForm_Of_Connect_And_Choise_FI.Connect(top_,left_:Integer);
begin
    Top:=top_;
    Left:=left_;
    Visible:=True;
end;


procedure TForm_Of_Connect_And_Choise_FI.FormCreate(Sender: TObject);
begin
    myStakan:=TStakan_Translator.Create(Form_Of_Connect_And_Choise_FI);
end;

procedure TForm_Of_Connect_And_Choise_FI.FormDestroy(Sender: TObject);
begin
    myStakan.Free;
end;

procedure TForm_Of_Connect_And_Choise_FI.ConnectBtnClick(Sender: TObject);
begin
    myStakan.Top:=Top;
    myStakan.Left:=Left;
    myStakan.Visible:=True;
    myStakan.OpenStakan(SlotCB.ItemIndex,ServerEdit.Text,LoginEdit.Text,PasswordEdit.Text,'','');
    Visible:=False;
end;

end.
